﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LINQwithArrayOfObjects
{
    class Employee
    {
        private decimal monthlySalaryValue;

        public string FirstName { get; set; }

        public string LastName { get; set; }

        public Employee(string lName, string fName, decimal salary)
        {
            FirstName = fName;
            LastName = lName;
            monthlySalaryValue = salary;
        }//end Employee constructor

        public decimal MonthlySalaryValue
        {
            get
            {
                return monthlySalaryValue;
            }//end get 
            set
            {
                if (value >= 0M)
                {
                    monthlySalaryValue = value;
                }
            }//end set
        }//end property MonthlySalaryValue

        public override string ToString()
        {
            return string.Format("{0,-10}{1,-10}{2,10:C}", FirstName, LastName, MonthlySalaryValue);
        }//end method ToString 
    }//end class Employee
}
